<?php
if(!isset($_SESSION))
{
   session_start();
}

/**if( !function_exists('__autoload') )
{
    function __autoload($class_name) {
    require_once '../'.$class_name . '.php';
    echo "require_once('../".$class_name . ".php');<br>";
    }
**/
require_once('../Ano.php');
require_once('../Programa.php');
require_once('../Campus.php');
require_once('../Fonte.php');
require_once('../Empenho.php');
require_once('../NomePrograma.php');
require_once('../Reserva.php');
require_once('../Rateio.php');
require_once('../RateioDAO.php');
require_once('../Setor.php');
require_once('../SetorDAO.php');
require_once('../NaturezaDespesa.php');
require_once('../SubElemento.php');
require_once('../Licitacao.php');
require_once('../ProcessoDAO.php');
require_once('../PlanoInterno.php');
require_once('../Fornecedor.php');
require_once('../FornecedorDAO.php');    
require_once('../ServidorDAO.php');    
require_once('../Servidor.php');    
require_once('../Material.php');


$processoDAO = new Processo();
$unidade = new Campus();
//$empenho = new Empenho();
$processo = $processoDAO->CarregarProcesso($_GET['idprocesso']);


$html.='<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<style>
.tituloTable{
text-align: center;
vertical-align: middle;
font-weight: bold;
border: 1px solid #000;
}
.tituloTableExt{
text-align: center;
vertical-align: middle;
font-weight: bold;
border: 1px solid #000;
width:100px;
}
</style>
</head>
<body style="font-size: smaller">                       
           
        <table  style="width: 250px;">
            <tr>
                <td>
                    <img src="../templates/IFF.jpg"/>
                </td>
                <td style="text-align: center; vertical-align: top; width: 250px;">
                    <b>Pr&oacute;-Reitoria de Administra&ccedil;&atilde;o e Planejamento<br>
                    Departamento de Or&ccedil;amento, Planejamento e Obras<br>
                    Coordena&ccedil;&atilde;o de Or&ccedil;amento</b>
                </td>
            </tr>
        </table>                       
        <br>
        <br>
        <br>
        <br>
';
             
                
                $html .= '<div style="width: 810px; padding-left:20px;"><span style="font-weight: bold;">I. Objeto</span>&nbsp;</div>';                            
                $html .= '<div style="width: 810px; padding-left:30px;">'.$processo->objeto.'</div><br><br>';
                
                $html .= '<div style="width: 810px; padding-left:20px;"><span style="font-weight: bold;">II. Justificativa</span>&nbsp;</div>';                            
                $html .= '<div style="width: 810px; padding-left:30px;"">'.$processo->justificativa.'</div><br><br>';
                
                $html .= '<div style="width: 810px; padding-left:20px;"><span style="font-weight: bold;">III. Modalidade da Licita&ccedil;&atilde;o</span>&nbsp;</div>';
                $html .= '<div style="width: 810px; padding-left:30px;""></div>';
                
                $html .= '<div style="width: 810px; padding-left:20px;"><span style="font-weight: bold;">IV. Metas F&iacute;sicas</span>&nbsp;
                    <br>
                    <br>
                    <table border="1" style="border-collapse:collapse; border:1px solid #000;">
                    <tr>
                        <td class="tituloTable" colspan="5">Unidade Maceio</td>
                    </tr>
                    <tr>
                       <td class="tituloTable">Item<br>Nº</td>
                       <td class="tituloTable">Cód<br>CatMat</td>
                       <td class="tituloTableExt">Especificacao</td>
                       <td class="tituloTable">Unidade</td>
                       <td class="tituloTable">Quantidade</td>
                    </tr>
                    <tr>
                       <td >1</td>
                       <td >22233</td>
                       <td >eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee<br>eeeeeeeeeeeeeeeeeeeeeeee</td>
                       <td >UN</td>
                       <td >2</td>
                    </tr>
                    
                    </table>
                </div>';//fim das metas fisicas
                
                $html .= '<div style="width: 810px; padding-left:20px;"><span style="font-weight: bold;">VI. Obriga&ccedil;&otilde;es do IFAL</span>&nbsp;</div>';
                $html .= '<div style="width: 810px; padding-left:30px;">'.$processo->responsabilidadeIFAL.'</div><br><br>';

                
                $html .= '<div style="width: 810px; padding-left:20px;"><span style="font-weight: bold;">VII. Obriga&ccedil;&otilde;es do Contratado</span>&nbsp;</div>';                            
                $html .= '<div style="width: 810px; padding-left:30px;"">'.$processo->responsabilidadeContratado.'</div><br><br>';
                
                
             $html .= '    </body>
                        </html>';
             //echo $html;
            require_once ('../dompdf/dompdf_config.inc.php') ; 

            $dompdf = new DOMPDF();
            $dompdf->load_html(utf8_decode($html));
            $dompdf->set_paper("a4", "portrait");
            $dompdf->render();
            $dompdf->stream("termoRef.pdf");             

?>        
